// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_APP_ITEM
// * CreateDate    : 2014-06-05 18:30:35
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:35
// * LastChanger   : 2014-06-05 18:30:35
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class SalesAppItemEntity : EntityBase
    {
        public SalesAppItemTable TableSchema
        {
            get
            {
                return SalesAppItemTable.Current;
            }
		}
		
		public SalesAppItemEntity()
        {

        }
		
		public SalesAppItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.AppId = Convert.ToString(CommonFunctions.ToObject(dr["APP_ID"]));
			this.AppNo = Convert.ToString(CommonFunctions.ToObject(dr["APP_NO"]));
			this.ContactUser = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_USER"]));
			this.ContactId = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_ID"]));
			this.ReqDeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["REQ_DELIVERY_DATE"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.ProductSpec = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.CustomerModel = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_MODEL"]));
            this.ItemType = Convert.ToString(CommonFunctions.ToObject(dr["ITEM_TYPE"]));
			this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.PriceType = Convert.ToString(CommonFunctions.ToObject(dr["PRICE_TYPE"]));
			this.ProductType = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TYPE"]));
			this.PackageType = Convert.ToString(CommonFunctions.ToObject(dr["PACKAGE_TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }
		
		public SalesAppItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.AppId = Convert.ToString(CommonFunctions.ToObject(dr["APP_ID"]));
			this.AppNo = Convert.ToString(CommonFunctions.ToObject(dr["APP_NO"]));
			this.ContactUser = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_USER"]));
			this.ContactId = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_ID"]));
			this.ReqDeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["REQ_DELIVERY_DATE"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.ProductSpec = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.CustomerModel = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_MODEL"]));
            this.ItemType = Convert.ToString(CommonFunctions.ToObject(dr["ITEM_TYPE"]));
			this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.PriceType = Convert.ToString(CommonFunctions.ToObject(dr["PRICE_TYPE"]));
			this.ProductType = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TYPE"]));
			this.PackageType = Convert.ToString(CommonFunctions.ToObject(dr["PACKAGE_TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SalesAppItemTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_ID)); }
            set { SetData(SalesAppItemTable.C_ID, value); }
        }
		
        [DataMember]
        public string AppId
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_APP_ID)); }
            set { SetData(SalesAppItemTable.C_APP_ID, value); }
        }
		
        [DataMember]
        public string AppNo
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_APP_NO)); }
            set { SetData(SalesAppItemTable.C_APP_NO, value); }
        }
		
        [DataMember]
        public string ContactUser
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_CONTACT_USER)); }
            set { SetData(SalesAppItemTable.C_CONTACT_USER, value); }
        }
		
        [DataMember]
        public string ContactId
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_CONTACT_ID)); }
            set { SetData(SalesAppItemTable.C_CONTACT_ID, value); }
        }
		
        [DataMember]
        public DateTime ReqDeliveryDate
        {
            get { return Convert.ToDateTime(GetData(SalesAppItemTable.C_REQ_DELIVERY_DATE)); }
            set { SetData(SalesAppItemTable.C_REQ_DELIVERY_DATE, value); }
        }
		
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_PRODUCT_ID)); }
            set { SetData(SalesAppItemTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public string ProductName
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_PRODUCT_NAME)); }
            set { SetData(SalesAppItemTable.C_PRODUCT_NAME, value); }
        }
		
        [DataMember]
        public string ProductCode
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_PRODUCT_CODE)); }
            set { SetData(SalesAppItemTable.C_PRODUCT_CODE, value); }
        }
		
        [DataMember]
        public string ProductSpec
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_PRODUCT_SPEC)); }
            set { SetData(SalesAppItemTable.C_PRODUCT_SPEC, value); }
        }
		
        [DataMember]
        public string Material
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_MATERIAL)); }
            set { SetData(SalesAppItemTable.C_MATERIAL, value); }
        }
		
        [DataMember]
        public string CustomerModel
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_CUSTOMER_MODEL)); }
            set { SetData(SalesAppItemTable.C_CUSTOMER_MODEL, value); }
        }

        [DataMember]
        public string ItemType
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_ITEM_TYPE)); }
            set { SetData(SalesAppItemTable.C_ITEM_TYPE, value); }
        }
		
        [DataMember]
        public decimal Length
        {
            get { return Convert.ToDecimal(GetData(SalesAppItemTable.C_LENGTH)); }
            set { SetData(SalesAppItemTable.C_LENGTH, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_UNIT)); }
            set { SetData(SalesAppItemTable.C_UNIT, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(SalesAppItemTable.C_QTY)); }
            set { SetData(SalesAppItemTable.C_QTY, value); }
        }
		
        [DataMember]
        public int IsTax
        {
            get { return Convert.ToInt32(GetData(SalesAppItemTable.C_IS_TAX)); }
            set { SetData(SalesAppItemTable.C_IS_TAX, value); }
        }
		
        [DataMember]
        public decimal Price
        {
            get { return Convert.ToDecimal(GetData(SalesAppItemTable.C_PRICE)); }
            set { SetData(SalesAppItemTable.C_PRICE, value); }
        }
		
        [DataMember]
        public decimal SubTotal
        {
            get { return Convert.ToDecimal(GetData(SalesAppItemTable.C_SUB_TOTAL)); }
            set { SetData(SalesAppItemTable.C_SUB_TOTAL, value); }
        }
		
        [DataMember]
        public string PriceType
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_PRICE_TYPE)); }
            set { SetData(SalesAppItemTable.C_PRICE_TYPE, value); }
        }
		
        [DataMember]
        public string ProductType
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_PRODUCT_TYPE)); }
            set { SetData(SalesAppItemTable.C_PRODUCT_TYPE, value); }
        }
		
        [DataMember]
        public string PackageType
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_PACKAGE_TYPE)); }
            set { SetData(SalesAppItemTable.C_PACKAGE_TYPE, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_REMARK)); }
            set { SetData(SalesAppItemTable.C_REMARK, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(SalesAppItemTable.C_STATUS)); }
            set { SetData(SalesAppItemTable.C_STATUS, value); }
        }
		
		#endregion
	}
	
	
}	

